package org.dxy.api.dto.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 分页请求参数
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageRequest {
    /** 当前页码，从1开始 */
    private long current = 1;
    /** 每页大小 */
    private long size = 10;
    
    /**
     * 获取偏移量
     */
    public long getOffset() {
        return (current - 1) * size;
    }
}